"""离线脚本-初始化价格策略"""
import init_base

# 然后就可以 使用django的models了
from web import models
from utils.myencrypt import myMd5
# models.UserInfo.objects.create(user_name="user1",email="abc@qq.com",mobile_phone="13877556699",password=myMd5("1"))
# models.Price.objects.create(title="免费版",unit_price="0",project_total=5,project_members=5,space_size=5,file_size=2)
# models.Price.objects.create(title="标准版",unit_price="299.00",project_total=10,project_members=10,space_size=10,file_size=100)

def run():
    exists = models.Price.objects.filter(category=1,title="个人免费版").exists()
    if not exists:
        models.Price.objects.create(
            category=1,
            title="个人免费版",
            unit_price="0",
            project_total=5,
            project_members=5,
            space_size=5,
            file_size=1
        )
    exists2 = models.Price.objects.filter(category=2, title="收费版").exists()
    if not exists2:
        models.Price.objects.create(
            category=2,
            title="收费版",
            unit_price="999",
            project_total=100,
            project_members=100,
            space_size=102400,
            file_size=1024
        )
if __name__ == '__main__':
    run()